let Mock = require('mockjs') //引入mock
let express=require('express')
const loginData = require('./common/login.json')
const loginsearch = require('./common/loginRead.json')
const side=require('./common/side.json')
let app = express() //实例化express


//左菜单
app.use('/user/side',function(req,res){
console.log(req,'req');
res.json(
    Mock.mock({
    status:200,
    msg:'获取左菜单成功',
    side
    })
  )
})

/**登录接口 */
app.use('/user/login', function (req, res) {
 console.log(req, 'req')
 res.json(
  Mock.mock({
   status: 200,
   msg: '登录成功',
   loginData
 })
)
})

/**登录日志 */
app.use('/home/loginsearch', function (req, res) {
 res.json(
  Mock.mock({
   status: 200,
   msg: '登录成功',
   loginsearch
 })
)
})

app.listen('8090', () => {
 console.log('监听端口 8090')
})

